package com.zhima.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhima.dto.*;
import com.zhima.entity.OjQuestionPublish;
import com.zhima.vo.*;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhima
 * @since 2023-08-25
 */
public interface OjQuestionPublishService extends IService<OjQuestionPublish> {

    boolean submitPublishQuestion(Long userId, Long questionId);

    Page<QuestionPublishVO> pageQueryQuestionPublish(Long userId, Long pageNum, Long pageSize);

    List<SimpleQuestionVO> batchQuerySimpleQuestionByIds(List<Long> questionIds);

    Long queryQuestionVersion(Long questionId);

    FeignQuestionBasicInfoDTO queryQuestionBasicInfo(Long questionId);

    FeignQuestionJudgeInfoDTO queryQuestionJudgeInfo(Long questionId);

    FeignQuestionJudgeScoreInfoDTO queryQuestionJudgeScoreInfo(Long questionId);

    Page<QuestionTableVO> pageQueryQuestionPublishByConditions(Long pageNum, Long pageSize, Long userId, QueryQuestionCondition queryQuestionCondition);

    QuestionPublishDetailVO queryQuestionDetailById(Long userId, Long questionId);

    boolean increaseSubmitNum(Long questionId);

    boolean increaseAcNum(Long questionId);

    List<UserDTO> questionRandomAcUser(Long questionId);

    void assembleQuestionAc(Long userId, List<QuestionTableVO> questionTableVOS);

    OjQuestionPublish publishQuestionAudit(Long questionAuditId);

    OjQuestionPublish publishQuestionToRedis(OjQuestionPublish ojQuestionPublish, long questionId);

    void publishQuestionToEs(OjQuestionPublish ojQuestionPublish, long questionId);

    boolean cancelSubmitQuestionPublish(Long questionId);

    Long getQuestionIdByQuestionNumber(String questionNumber);

    List<QuestionBankContestEditQuestionVO> assembleQuestion(List<Long> questionIds);

    List<Integer> listFullMarks(List<Long> questionIds);
}